<script src='http://shjs.sourceforge.net/lang/sh_javascript.js'></script>
<script src='http://shjs.sourceforge.net/sh_main.js'></script>
<link rel="stylesheet" href="../style/style.css">
<link rel='stylesheet' type='text/css' href='../style/code.css'>

<body onload="sh_highlightDocument('sh', 'javascript');">
<div id='supercontainer' ><title>
What's Next?
</title>
<h1 id="whats-next">What's Next?</h1>
<h2 id="moving-beyond-the-learning-exercise">Moving beyond the learning exercise</h2>
<p>Once you've got a good handle on the API library functions.</p>
<center>
<img src="../images/functions.png" width="80%" alt="Plugin functions" title="Plugin functions">
</center>

<p>The next step is to make your own extension. Here is the process we recommend.</p>
<ul>
<li>Start simple. Copy the plugin folder to a new extension and make your own simple browser action extension.</li>
</ul>
<p>This can be a good starting point regardless of the type of extension you are thinking about making.</p>
<p>You may notice that the filenames of the plugins have an underscore and then a unique name. This is because the NPAPI plugin is setup as private and you need to make sure your .dll, .plugin, or .so file is unique on a user's computer. Just add any string you feel is sufficiently unique (reverse DNS not required but works).</p>
<p>Next update your manifest.json file to point to your uniquely named plugins.</p>
<p>This step is not required for development on your local computer, but you may as well get this tedious step over with now. For development just make sure you don't have two extensions enabled with the same private plugin filename.</p>
<ul>
<li>Next move the embed element and boilerplate initialization onto the extension background page.</li>
</ul>
<p>We recommend putting the embed on the background page then adding the GTVRemote object to that page. Do all the boilerplate initialization during Chrome startup on your background page.</p>
From background page JavaScript, store the GTVRemote on the window.
<pre class="sh_javascript"><code>window.googletvremote = pluginEl.gtvremote.plugin.object.GTVRemote();
</code></pre>

<p>Then you can access the GTVRemote object from a popup window or a content script. This is really important for extensions that use content scripts.</p>
From the popup window or content script retrieve the background page GTVRemote object.
<pre class="sh_javascript"><code>var backgroundPageWindow = chrome.extension.getBackgroundPage();
var googletvremote = backgroundPageWindow.googletvremote;
</code></pre>

<p>Using the background page to your advantage is a great Chrome Extension tool.</p>
<h2 id="extension-ideas">Extension ideas</h2>
<p>We're all really creative and have a lot of fun ideas to implement. Just to get you started thinking about ideas here are some use cases for the extension plugin.</p>
<center>
<img src="../images/use_cases.png" width="70%" alt="Use cases" title="Use cases">
</center>

<h2 id="interactive-web-content">Interactive web content</h2>
<p>If you own web content that you'd like to make interactive with the Google TV you could write a Chrome Extension with a content script. In the manifest file set the content script to be added only to your own pages. Then write a content script that adds JavaScript to your site. For example, if you have videos on your page you could add JavaScript code that would present a UI to let a site visitor play the video on their TV instead.</p>
<center>
<img src="../images/play_on_tv.png" width="50%" alt="Play on TV" title="Play on TV">
</center>

<p>Another way to make your page stand out a bit.</p>
<h2 id="app-controller">App controller</h2>
<p>If you are an Android developer and have an app that runs on Google TV you could control it remotely. Is there value in having a custom remote control for your game? You can easily play multiplayer games with multiple computers instead of fighting over one TV remote control.</p>
<center>
<img src="../images/game_controller.png" width="50%" alt="Game controller" title="Game controller">
</center>

<h2 id="other-extension-ideas">Other extension ideas</h2>
<p>If you're not trying to integrate with existing web content and you don't have a Google TV app, then maybe you have some other great idea. There is a lot of information that your computer knows that you could share with your TV. For example chat messages, events, reminders, etc.</p>
<center>
<img src="../images/dinner_done.png" width="50%" alt="Dinner is done" title="Dinner is done">
</center>

<p>This part is totally up to you. :)</p>
<center>
<img src="../images/youtube_flinger.png" width="50%" alt="App idea" title="YouTube flinger extension">
</center>

<p>That's it! Happy coding. Feel free to contribute your work to this code project!</p>
<p><a href="../instructions.html">Back to main page</a></p>
